<%--
  User: MadFrog
  Date: 2016/11/5
  Time: 17:19
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
    <title>绑定学号</title>
    <%@include file="../common/_head.jsp" %>
</head>
<body ontouchstart>
<div class="weui-cells weui-cells_form">
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">学号</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" type="number" id="xh" pattern="[0-9]*" placeholder="请输入学号">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">身份证号</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" id="sfzh" placeholder="请输入身份证号">
        </div>
    </div>
</div>
<div class="weui-cells weui-cells_form">
    <a href="javascript:;" class="weui-btn weui-btn_primary" id="submitButton">确定</a>
</div>

<br>
<br>
<div class="weui-msg__text-area">
    <p class="weui-msg__desc">
        如需解除绑定请联系
        <a href=mailto:crossfire_sli@qq.com>crossfire_sli@qq.com</a>
    </p>
</div>


<%@include file="../common/_foot.jsp" %>

<script>
    $("#submitButton").click(function () {
        var xh = $('#xh').val();
        var sfzh = $('#sfzh').val();
        var params = {};
        params.xh = xh;
        params.sfzh = sfzh;
        $.ajax({
            type: "post",
            url: "bindStudent",
            data: params,
            dataType: "json",
            success: function (wechatReturn) {
                $.alert(wechatReturn.msg);
                window.location.href = "index";
            },
            error: function (wechatReturn) {
                $.alert("绑定失败！");
            }
        });
    });
</script>
<div class="weui-footer weui-footer_fixed-bottom">
    <p class="weui-footer__text">
        Copyright © 2016-2018 应用技术系<br>
        四川幼儿师范高等专科学校
    </p>
</div>
</body>
</html>
